Rails.application.routes.draw do

  mount AjaxAPI => '/'
  mount ActionCable.server => '/cable'
  # devise_for :users
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".
#controllers: { sessions: "sessions", registrations: "registrations" }
  # devise_for :users, path_names: { sign_in: 'login', sign_out: 'logout',
  #   password: 'secret', confirmation: 'verification', unlock: 'unblock', registration: 'register', sign_up: 'cmon_let_me_in' }
  # You can have the root of your site routed with "root"
  resource :session
  resource :passwords

  root "home#show"

  namespace :admin do
    resource :session
  end
  resources :stores

  namespace :sales do
    resource :session
    resource :register, only: [:new, :create]
  end

  devise_for :users, 'controllers': { sessions: "users/sessions", registrations: "users/registrations" }
  root 'ruiqu/stores#show'
  draw :ruiqu

  draw :api

  namespace :ems do
    resources :store_staffs do
      member do
        get :pwd
        put :reset_password
      end
      resources :records, only: [:index]
    end

    resources :store_staff_salaries
    resources :store_staff_events
  end# end ems namespace


  draw :sales

  namespace :settings do
    resource :organizational_structure
  end

  namespace :tools do
    resource :translate
  end

  resource :profile

  require 'sidekiq/web'
  mount Sidekiq::Web, at: '/sidekiq'
end
